package com.example.basicknowledge.ViewPager_Fragment;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class CategoryAdapter extends FragmentPagerAdapter {
    public CategoryAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int i) {
        if (i == 0) {
            return new BlankFragmentOne();
        } else if (i == 1) {
            return new BlankFragmentOne();
        } else if (i == 2) {
            return new BlankFragmentOne();
        } else {
            return new BlankFragmentOne();
        }
    }

    @Override
    public int getCount() {
        return 4;
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        if (position == 0) {
            return "one";
        } else if (position == 1) {
            return "two";
        } else if (position == 2) {
            return "three";
        } else {
            return "default";
        }
    }
}
